import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";


// 蒋恺-----路由页面
import MyLogin from "../views/mypage_jk/MyLogin.vue"; // 我的 已登录 页面
import MynotLogin from "../views/mypage_jk/MynotLogin.vue"; // 我的 未登录 页面
import BianJi from "../views/mypage_jk/BianJi.vue"; // 我的 资料编辑 页面
import PersonalView from "../views/mypage_jk/PersonalView.vue"; // 我的 个人主页 页面
import FansView from "../views/mypage_jk/FansView.vue"; // 我的 粉丝 页面
import VipCenter from "../views/mypage_jk/VipCenter.vue"; // 我的 开通会员 页面
import NotesView from "../views/mypage_jk/NotesView.vue"; // 我的 笔记 页面
import NoteList from "../views/mypage_jk/NoteList.vue"; // 我的 笔记列表 页面
import NoteDetails from "../views/mypage_jk/NoteDetails.vue"; // 我的 笔记详情 页面
import ClassIfication from "../views/mypage_jk/ClassIfication.vue"; // 分类 分类主 页面
//施佤彝-----路由页面
import ListeningView from "@/views/mypage-swy/ListeningBookMainPage.vue";//听书主页面
import Listening from "@/views/mypage-swy/Listening";//正在听书
import Usercenter from "@/views/mypage-swy/Usercenter";//用户中心
import Talking from "@/views/mypage-swy/Talking";//聊天页面
import Bookshelf from "@/views/mypage-swy/Bookshelf";//书架
import QRcode from "@/views/mypage-swy/QRcode";//扫码
import History from "@/views/mypage-swy/History";//历史阅读
import Bookslist from "@/views/mypage-swy/Bookslist";//书单
import Createbooklist from "@/views/mypage-swy/Createbooklist";//创建书单

// const HomeFn = ()=> {
//    return import('@/views/mypage-swy/Bookshelf')
// };

//卢兰-----路由页面
import XiTong from "../views/mypage_lulan/XiTong.vue";//系统设置
import ZhangHao from "../views/mypage_lulan/ZhangHao.vue";//账号设置
import XiuGaimm from "../views/mypage_lulan/XiuGaimm.vue";//修改密码
import YinSi from "../views/mypage_lulan/YinSi.vue";//隐私设置
import YueDu from "../views/mypage_lulan/YueDu.vue";//阅读设置
import TongZhi from "../views/mypage_lulan/TongZhi.vue";//通知设置
import GuanYuWoMen from "../views/mypage_lulan/GuanYuWoMen.vue";//关于我们
import ZhengCe from "../views/mypage_lulan/ZhengCe.vue";//隐私政策

//王妍-----路由页面
import bookdetail from "../views/mypage_wy/bookdetail.vue";
import allComments from "../views/mypage_wy/allComments.vue";
import list from "../views/mypage_wy/list.vue";
import readingPage from "../views/mypage_wy/readingPage.vue";
import specialHearing from "../views/mypage_wy/specialHearing.vue";
import contentVaildity from "../views/mypage_wy/contentVaildity.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    component: HomeView,
    redirect: "/usercenter",//这里的需要改成 书城主页  暂时替代
    children: [
      //用户中心 -----------这里的需要改成 书城主页  暂时替代
      {
        path: "/usercenter",
        name: "usercenter",
        component: Usercenter,
      },
      // 我的  已登录页面
      {
        path: "/mylogin",
        name: "mylogin",
        component: MyLogin,
      },
      // 我的 未登录页面
      {
        path: "/mynotlogin",
        name: "mynotlogin",
        component: MynotLogin,
      },
      // 分类  主页面
      {
        path: "/classification",
        name: "classification",
        component: ClassIfication,
      },
      {
        //书架
        path: "/bookshelf",
        name: "bookshelf",
        component: Bookshelf,
        redirect: "/bookshelf1",
        children: [
          {
            //书架平铺
            path: "/bookshelf1",
            name: "bookshelf1",
            component: (resolve) =>
              require(["@/components/mycomponents-swy/Bookshelf1"], resolve),
          },
          {
            //书架轮播图
            path: "/bookshelf2",
            name: "bookshelf2",
            component: (resolve) =>
              require(["@/components/mycomponents-swy/Bookshelf2"], resolve),
          },
        ],
      },
    ]
  },

  {
    //正在听书页面
    path: "/listening",
    name: "listening",
    component: Listening,
  },
  {
    path: "/about",
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/AboutView.vue"),
  },
  //卢兰  系统页面
  {
    path: "/xitong",
    name: "xitong",
    component: XiTong,
  },
  //卢兰 账号安全
  {
    path: "/zhanghao",
    name: "zhanghao",
    component: ZhangHao,
  },
  //卢兰 修改密码
  {
    path: "/xiugaimm",
    name: "xiugaimm",
    component: XiuGaimm,
  },
    
   //卢兰 隐私设置
   {
    path: "/yinsi",
     name: "yinsi",
     component: YinSi,
   },
   //卢兰 阅读设置
   {
    path: "/yuedu",
     name: "yuedu",
     component: YueDu,
   },
   //卢兰 通知设置
   {
    path: "/tongzhi",
     name: "tongzhi",
     component: TongZhi,
   },
   //卢兰 关于我们
   {
    path: "/guanyuwomen",
     name: "guanyuwomen",
     component: GuanYuWoMen,
   },
   //卢兰 隐私政策
   {
    path: "/zhengce",
     name: "zhengce",
     component: ZhengCe,
   },
  //wy 书籍详情
  {
    path: "/bookdetail",
    name: "bookdetail",
    component: bookdetail,

  },
  //全部评论

  { path: "/allComments",
  name: "allComments",
  component: allComments,
  
},
//目录
{ path: "/list",
  name: "list",
  component: list,
  
},
//阅读页
{ path: "/readingPage",
  name: "readingPage",
  component: readingPage,
  
},
//内容简介
{ path: "/contentVaildity",
  name: "contentVaildity",
  component: contentVaildity,
  
},
//专题听书
{
  path: "/specialHearing",
  name: "specialHearing",
  component: specialHearing,
},

  {
    path: "/allComments",
    name: "allComments",
    component: allComments,

  },
  //目录
  {
    path: "/list",
    name: "list",
    component: list,

  },
  //阅读页
  {
    path: "/readingPage",
    name: "readingPage",
    component: readingPage,

  },
  //内容简介
  {
    path: "/contentVaildity",
    name: "contentVaildity",
    component: contentVaildity,

  },
  //专题听书
  {
    path: "/specialHearing",
    name: "specialHearing",
    component: specialHearing,
  },
  {
    path: "/allComments",
    name: "allComments",
    component: allComments,

  },
  //目录
  {
    path: "/list",
    name: "list",
    component: list,

  },
  //阅读页
  {
    path: "/readingPage",
    name: "readingPage",
    component: readingPage,

  },
  //专题听书
  {
    path: "/specialHearing",
    name: "specialHearing",
    component: specialHearing,
  },

  {
    //听书主页面
    path: "/listeningbook",
    name: "lsiteningbook",
    component: ListeningView,
    redirect: "/catalogue",
    children: [
      {
        //听书目录
        path: "/catalogue",
        name: "catalogue",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Catalogue"], resolve),
      },
      {
        //听书书籍推荐
        path: "/review",
        name: "review",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Review"], resolve),
      },
      {
        //听书评论
        path: "/recommend",
        name: "recommend",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Recommend"], resolve),
      },
    ],
  },
  {
    //用户中心
    path: "/usercenter",
    name: "usercenter",
    component: Usercenter,
  },
  {
    //聊天
    path: "/talking",
    name: "talking",
    component: Talking,
  },

  {
    //扫码
    path: "/qrcode",
    name: "qrcode",
    component: QRcode,
  },
  {
    //阅读历史
    path: "/history",
    name: "history",
    component: History,
    redirect: "/books",
    children: [
      {
        //历史书籍
        path: "/books",
        name: "books",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Books"], resolve),
      },
      {
        //听书历史
        path: "/listen",
        name: "listen",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Listenbook"], resolve),
      },
      {
        //下载
        path: "/load",
        name: "load",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Loadbook"], resolve),
      },
    ],
  },
  {
    //书单
    path: "/bookslist",
    name: "bookslist",
    component: Bookslist,
    redirect: "/createlist",
    children: [
      {
        //创建的书单
        path: "/createlist",
        name: "createlist",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Mycreatelist"], resolve),
      },
      {
        //收藏的书单
        path: "/collectlist",
        name: "collectlist",
        component: (resolve) =>
          require(["@/components/mycomponents-swy/Mycollectlist"], resolve),
      },
    ],
  },
  {
    //新建书单页面
    path: '/createbooklist',
    name: 'createbooklist',
    component: Createbooklist
  },



  // 我的 资料编辑 页面
  {
    path: "/bianji",
    name: "bianji",
    component: BianJi,
  },
  // 我的 个人主页 页面
  {
    path: "/personal",
    name: "personal",
    component: PersonalView,
  },
  // 我的 粉丝  页面
  {
    path: "/fans",
    name: "fans",
    component: FansView,
  },
  // 我的 笔记
  {
    path: "/notes",
    name: "notes",
    component: NotesView,
    redirect: "/notelist",
    children: [
      // 我的 笔记列表  页面
      {
        path: "/notelist",
        name: "notelist",
        component: NoteList,
      },
      // 我的 笔记详情  页面
      {
        path: "/notedetails",
        name: "notedetails",
        component: NoteDetails,
      },
    ],
  },
  {
    path: "/vipcenter",
    name: "vipcenter",
    component: VipCenter,
  },
  // {
  //   path: "/listening",
  //   name: "lsitening",
  //   component: ListeningView,
  //   children: [
  //     {
  //       path: "/catalogue",
  //       name: "catalogue",
  //       component: Catalogue,
  //     },
  //     {
  //       path: "/review",
  //       name: "review",
  //       component: Review,
  //     },
  //     {
  //       path: "/recommend",
  //       name: "recommend",
  //       component: Recommend,
  //     },
  //   ],
  // },
];

const router = new VueRouter({
  routes,
});
const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch((err) => err);
};

export default router;
